local yeyan = fk.CreateSkill {

  name = "joy__yeyan",

  tags = {  },

}



yeyan:addEffect(fk.EventPhaseStart, {
  name = "joy__yeyan",
  anim_type = "offensive",
  events = {fk.EventPhaseStart},
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(yeyan.name) and player.phase == Player.Play
  end,
  on_cost = function(self, event, target, player, data)
    local room = player.room
    local to = room:askForChoosePlayers(player, table.map(room:getOtherPlayers(player),  Util.IdMapper), 1, 1, "#joy__yeyan-choose", yeyan.name, true)
    if #to > 0 then
      event:setCostData(self, to[1])
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:damage({
      from = player,
      to = room:getPlayerById(event:getCostData(self)),
      damage = 1,
      damageType = fk.FireDamage,
      skillName = yeyan.name,
    })
  end,
})

return yeyan